fn main() {
    //整数相加
    println!("1+3={}", 1u32 + 3);
    println!("1-3={}", 1i32 - 3);
    //
    // 加到main方法上，会#[allow(arithmetic_overflow)]
    // thread 'main' panicked at 'attempt to subtract with overflow',
    // println!("1-3={}",1u32-3);

    println!("true AND false is {}", true && false);
    println!("true OR false is {}", true || false);
    println!("NOT true is {}", !true);

    println!("0011 AND 0101 IS {:04b}", 0b0011u32 & 0b0101);
    println!("0011 OR 0101 is {:04b}", 0b0011 | 0b0101);
    println!("0011 XOR 0101 is {:04b}", 0b0011u32 ^ 0b0101);
    //out: 0110,两值相同，结果为0，不相同为1
    println!("1<<5,{}", 1 << 5);
    println!("0x80>>2 is 0x:{:x},0o:{0:o},0b:{0:b}", 0x80u32 >> 2);
    println!("一百万可写为{}", 1_000_000u32);
}
